/**
 * @desc
 * @author  刘贺[of2220]
 * @company qianmi.com
 * @Date    2017/2/7
 */
'use strict';
let commonUtil = require('@qianmi/x-site-common/util/common-util');

let config = {
    envCode: commonUtil.getEnvCode(),
};
if (process.env.XSITE_CONFIG_DIR) {
    console.log('从环境变量中读取配置文件信息,路径如下:', process.env.XSITE_CONFIG_DIR);
    let fs = require('fs-extra');
    let path = require('path');
    config = Object.assign(config, {
        dataBaseConfig: fs.readJsonSync(path.join(process.env.XSITE_CONFIG_DIR, 'data-base-config.json')),
        ossConfig: fs.readJsonSync(path.join(process.env.XSITE_CONFIG_DIR, 'oss-config.json'))
    });
} else {
    config = Object.assign(config, {
        dataBaseConfig: require('./dev/data-base-config.json'),
        ossConfig: require('./dev/oss-config.json')
    });
}
console.log('配置信息为: ', config);
module.exports = config;